//数据库连接文件
const mongoose = require('mongoose');
mongoose.connect('mongodb://localhost/zhudeyi', {useNewUrlParser: true,useUnifiedTopology: true});


const db = mongoose.connection;// 数据库连接对象
db.on('error', ()=>{ console.log('数据库连接失败')});
db.once('open', function() {
  console.log('数据库连接成功')
});
